<!DOCTYPE html>
<html lang="en">

<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <block name="style">
        <link rel="stylesheet" href="__MYCSS__/main.min.css">
    </block>
</head>
<extend name="Public/base" />
<block name="body">

    <body>

        <ol class="breadcrumb">
            <li><a href="#">财务管理</a></li>
            <li class="active">传输成本明细表</li>
        </ol>
        <p>
            <a class="btn btn-primary" role="button" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">查询</a>
            <button type="button" class="btn btn-default" data-toggle="modal" data-target="#addModal">添加</button>
        </p>
        <div class="collapse" id="collapseExample">
            <div class="well">
                <form method="GET" action="{:U('lst')}">
                    <div class="row">
                        <div class="col-lg-2">
                            <div class="form-group">
                                <label for="gysmc">供应商名称：</label>
                                <select class="form-control " name="gysmc">
                                <option value="">--请选择--</option>
                                <volist name="gysmc_arr" id="gysmc">
                                    <option value="{$gysmc}">{$gysmc}</option>
                                </volist>
                            </select>
                            </div>
                        </div>
                        <div class="col-lg-2">
                            <div class="form-group">
                                <label for="dynbgs">对应内部公司：</label>
                                <select class="form-control " name="dynbgs">
                                <option value="">--请选择--</option>
                                <volist name="dynbgs_arr" id="dynbgs">
                                    <option value="{$dynbgs}">{$dynbgs}</option>
                                </volist>
                            </select>
                            </div>
                        </div>
                        <div class="col-lg-2">
                            <div class="form-group">
                                <label for="htbh">合同编号</label>
                                <select class="form-control " name="htbh">
                                <option value="">--请选择--</option>
                                <volist name="htbh_arr" id="htbh">
                                    <option value="{$htbh}">{$htbh}</option>
                                </volist>
                            </select>
                            </div>
                        </div>
                        <div class="col-lg-1">
                            <div class="form-group">
                                <label for="year">所属年份：</label>
                                <select class="form-control father_select year_select" name="year">
                                <option value="">--请选择--</option>
                            </select>
                            </div>
                        </div>
                        <div class="col-lg-1">
                            <div class="form-group">
                                <label for="month">所属月份：</label>
                                <select class="form-control son_select month_select" name="month" disabled="disabled">
                                            <option value="">--请选择--</option>
                                        </select>
                            </div>
                        </div>
                        <div class="col-lg-2">
                            <div class="form-group" style="margin-top: 24px;">
                                <button type="submit" class="btn btn-success">查询</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>


        <div class="panel panel-default">
            <div class="panel-heading">传输成本明细表</div>
            <div class="surface_table">
                <div class="table-head">
                    <table class="table table-bordered">
                        <thead>
                            <tr class="table-h">
                                <th>录入日期</th>
                                <th>所属月份</th>
                                <th>传输供应商名称</th>
                                <th>成本类型</th>
                                <th>对应内部公司</th>
                                <th>合同编号</th>
                                <th>是否需要开票</th>
                                <th>应付</th>
                                <th>应付调整</th>
                                <th>调整日期</th>
                                <th>调整原因</th>
                                <th>调整后应付</th>
                                <th>调整后应付占比</th>
                                <th>实付</th>
                                <th>付款日期</th>
                                <th>开票金额</th>
                                <th>开票日期</th>
                                <th>应付未付</th>
                                <th>应付未付占比</th>
                                <th>未开发票</th>
                                <th>合同约定账龄</th>
                                <th>账龄预警值</th>
                                <th>超账龄预警金额</th>
                                <th>3个月内应付未付额</th>
                                <th>3-6个月应付未付额</th>
                                <th>6个月以上应付未付额</th>
                                <th>特别说明</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                    </table>
                </div>
                <div class="table-body">
                    <table class="table table-hover table-bordered">
                        <tbody>
                            <volist name="lsts" id="list">
                                <tr>
                                    <td>{$list.updatetime}</td>
                                    <td>{$list.yf}</td>
                                    <td>{$list.gysmc}</td>
                                    <td>{$list.cblx}</td>
                                    <td>{$list.dynbgs}</td>
                                    <td>{$list.htbh}</td>
                                    <td>{$list.kp}</td>
                                    <td class="count_yf1">{$list.yf1}</td>
                                    <td class="count_tz">{$list.tz}</td>
                                    <td>{$list.tzrq}</td>
                                    <td>{$list.tzyy}</td>
                                    <td class="count_tzyf">{$list.tzyf}</td>
                                    <td>{$list.yfzb}</td>
                                    <td class="count_sf">{$list.sf}</td>
                                    <td>{$list.fkrq}</td>
                                    <td class="count_kpje">{$list.kpje}</td>
                                    <td>{$list.kprq}</td>
                                    <td class="count_yfwf">{$list.yfwf}</td>
                                    <td>{$list.wfzb}</td>
                                    <td class="count_fp">{$list.fp}</td>
                                    <td>{$list.zl}</td>
                                    <td>{$list.zlyjz}</td>
                                    <td style="min-width:160px">{$list.zlyjje}</td>
                                    <td style="min-width:160px">{$list.yfwfe3}</td>
                                    <td style="min-width:160px">{$list.yfwfe36}</td>
                                    <td style="min-width:160px">{$list.yfwfe6}</td>
                                    <td>{$list.tbsm}</td>
                                    <td>
                                        <button type="button" data-id="1" class="btn btn-warning update_btn" data-toggle="modal" data-target="#updateModal">修改</button>
                                        <a class="btn btn-danger delete_btn" href="{:U('del',array('id'=>$list['id']))}" role="button">删除</a>
                                    </td>
                                </tr>
                            </volist>
                            <tr>
                                <td colspan="7" style="text-align: center">总计</td>
                                <td id="count_yf1" class="count"></td>
                                <td id="count_tz" class="count"></td>
                                <td colspan="2"></td>
                                <td id="count_tzyf" class="count"></td>
                                <td></td>
                                <td id="count_sf" class="count"></td>
                                <td></td>
                                <td id="count_kpje" class="count"></td>
                                <td></td>
                                <td id="count_yfwf" class="count"></td>
                                <td></td>
                                <td id="count_fp" class="count"></td>
                                <td colspan="8"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!--添加面板-->
        <div class="modal fade bs-example-modal-lg" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog modal-lg" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">增加合同管理登记</h4>
                    </div>
                    <div class="modal-body">
                        <form id="khzyForm" class="public_form" action="{:U('add')}" method="post">
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addsssj">所属时间</label>
                                        <input type="text" class="form-control form_date" value="" id="addsssj" name="sssj" data-date-format="yyyy-mm-dd" readonly>
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <div class="form-group">
                                            <label for="adddynbgs">对应内部公司</label>
                                            <input type="text" class="form-control" id="adddynbgs" name="dynbgs">
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addgysmc">带宽供应商名称</label>
                                        <input type="text" class="form-control" id="addgysmc" name="gysmc">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addcblx">成本类型</label>
                                        <input type="text" class="form-control" id="addcblx" name="cblx">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addhtbh">合同编号</label>
                                        <input type="text" class="form-control" id="addhtbh" name="htbh">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="kp">是否开票：</label>
                                        <div>
                                            <label class="checkbox-inline">
                                            <input type="radio" name="kp" class="form-control" id="addkp" value="是" checked> 是
                                        </label>
                                            <label class="checkbox-inline">
                                            <input type="radio" name="kp" class="form-control" id="addkp" value="否"> 否
                                        </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addyf1">应付</label>
                                        <input type="text" class="form-control" id="addyf1" name="yf1">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addtz">应付调整</label>
                                        <input type="text" class="form-control" id="addtz" name="tz">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addtzrq">调整时间</label>
                                        <input type="text" class="form-control form_date" value="" id="addtzrq" name="tzrq" data-date-format="yyyy-mm-dd" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addtzyy">调整原因</label>
                                        <input type="text" class="form-control" id="addtzyy" name="tzyy">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addsf">实付</label>
                                        <input type="text" class="form-control" id="addsf" name="sf">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addfkrq">付款日期</label>
                                        <input type="text" class="form-control form_date" value="" id="addfkrq" name="fkrq" data-date-format="yyyy-mm-dd" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addkpje">开票金额</label>
                                        <input type="text" class="form-control" id="addkpje" name="kpje">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addkprq">开票日期</label>
                                        <input type="text" class="form-control form_date" value="" id="addkprq" name="kprq" data-date-format="yyyy-mm-dd" readonly>
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addfp">未开发票</label>
                                        <input type="text" class="form-control" id="addfp" name="fp">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addzl">合同约定账龄</label>
                                        <input type="text" class="form-control" id="addzl" name="zl">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addzlyjz">账龄预警值</label>
                                        <input type="text" class="form-control" id="addzlyjz" name="zlyjz">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addzlyjje">超账龄预警金额</label>
                                        <input type="text" class="form-control" id="addzlyjje" name="zlyjje">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addyfwfe3">3个月内应收未收额</label>
                                        <input type="text" class="form-control" id="addyfwfe3" name="yfwfe3">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addyfwfe6">6个月以上应收未收额</label>
                                        <input type="text" class="form-control" id="addyfwfe6" name="yfwfe6">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addyfwfe36">3-6个月应收未收额</label>
                                        <input type="text" class="form-control" id="addyfwfe36" name="yfwfe36">
                                    </div>
                                </div>
                            </div>
                            <div class="row">

                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addtbsm">特别说明</label>
                                        <input type="text" class="form-control" id="addtbsm" name="tbsm">
                                    </div>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                <button type="submit" class="btn btn-primary">保存表单</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <!--修改面板-->
        <div class="modal fade bs-example-modal-lg" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog modal-lg" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">修改合同管理登记</h4>
                    </div>
                    <div class="modal-body">
                        <form id="khzyForm" class="public_form update_form" action="{:U('edit')}" method="post">
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatesssj">所属时间</label>
                                        <input type="text" class="form-control form_date" value="" id="updatesssj" name="sssj" data-date-format="yyyy-mm-dd" readonly>
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <div class="form-group">
                                            <label for="updatedynbgs">对应内部公司</label>
                                            <input type="text" class="form-control" id="updatedynbgs" name="dynbgs">
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updategysmc">带宽供应商名称</label>
                                        <input type="text" class="form-control" id="updategysmc" name="gysmc">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatecblx">成本类型</label>
                                        <input type="text" class="form-control" id="updatecblx" name="cblx">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatehtbh">合同编号</label>
                                        <input type="text" class="form-control" id="updatehtbh" name="htbh">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="kp">是否开票：</label>
                                        <div>
                                            <label class="checkbox-inline">
                                            <input type="radio" name="kp" class="form-control" id="updatekp" value="是" checked> 是
                                        </label>
                                            <label class="checkbox-inline">
                                            <input type="radio" name="kp" class="form-control" id="updatekp" value="否"> 否
                                        </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updateyf1">应付</label>
                                        <input type="text" class="form-control" id="updateyf1" name="yf1">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatetz">应付调整</label>
                                        <input type="text" class="form-control" id="updatetz" name="tz">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatetzrq">调整时间</label>
                                        <input type="text" class="form-control form_date" value="" id="updatetzrq" name="tzrq" data-date-format="yyyy-mm-dd" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatetzyy">调整原因</label>
                                        <input type="text" class="form-control" id="updatetzyy" name="tzyy">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatesf">实付</label>
                                        <input type="text" class="form-control" id="updatesf" name="sf">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatefkrq">付款日期</label>
                                        <input type="text" class="form-control form_date" value="" id="updatefkrq" name="fkrq" data-date-format="yyyy-mm-dd" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatekpje">开票金额</label>
                                        <input type="text" class="form-control" id="updatekpje" name="kpje">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatekprq">开票日期</label>
                                        <input type="text" class="form-control form_date" value="" id="updatekprq" name="kprq" data-date-format="yyyy-mm-dd" readonly>
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatefp">未开发票</label>
                                        <input type="text" class="form-control" id="updatefp" name="fp">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatezl">合同约定账龄</label>
                                        <input type="text" class="form-control" id="updatezl" name="zl">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatezlyjz">账龄预警值</label>
                                        <input type="text" class="form-control" id="updatezlyjz" name="zlyjz">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatezlyjje">超账龄预警金额</label>
                                        <input type="text" class="form-control" id="updatezlyjje" name="zlyjje">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updateyfwfe3">3个月内应收未收额</label>
                                        <input type="text" class="form-control" id="updateyfwfe3" name="yfwfe3">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updateyfwfe6">6个月以上应收未收额</label>
                                        <input type="text" class="form-control" id="updateyfwfe6" name="yfwfe6">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updateyfwfe36">3-6个月应收未收额</label>
                                        <input type="text" class="form-control" id="updateyfwfe36" name="yfwfe36">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatetbsm">特别说明</label>
                                        <input type="text" class="form-control" id="updatetbsm" name="tbsm">
                                    </div>
                                </div>
                            </div>
                            <input type="hidden" id="update_id" name="id">
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                <button type="submit" class="btn btn-primary">保存表单</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <script src="__MYJS__/main.min.js"></script>
        <script src="__MYJS__/main.js"></script>
        <script src="__MYJS__/validator.js"></script>
        <script src="__MYJS__/table.js"></script>
        <script>
            (function () {
                // 修改按钮事件
                $("table").on("click", ".update_btn", function (e) {
                    e.stopPropagation();
                    var id = $(this).attr("data-id");
                    $.ajax({
                        url: "{:U('edit')}",
                        type: 'GET', //GET
                        data: {
                            id: id
                        },
                        success: function (data) {
                            $(".update_form .form-control").each(function (index, val) {
                                var self = this;
                                for (x in data) {
                                    if ($(self).attr("name") == x) {
                                        if (x == "kp" && $(self).attr("name") == x) {
                                            $(":radio[name='" + x + "'][value='" + data[
                                                    x] +
                                                "']").prop("checked", "checked");
                                        } else {
                                            $(self).val(data[x]);
                                        }
                                    }
                                }
                            });
                            // 重新更新日期选择器
                            $(".update_form .form_date").each(function (index, val) {
                                if ($(this).val() != "") {
                                    $(this).val(moment($(this).val(), "YYYYMMDD").format(
                                        "YYYY-MM-DD"))
                                }
                            })
                            $(".update_form .form_date").datetimepicker('update');
                        }
                    })
                    $("#update_id").val(id);
                    $('#updateModal').modal()
                })
                var zdytable = new window.zdytable();
            })()
        </script>


        <script>
        </script>
    </body>
</block>

</html>